/*
 * @Author: hq
 * @Date: 2022-05-31 10:14:52
 * @LastEditors: hq
 * @LastEditTime: 2022-05-31 10:15:17
 * @Description: base64转blob流
 * @version: 1.0
 */
export default function dataURLtoBlob(dataurl, name) { //base64转file
    var arr = dataurl.split(',');
    mime = arr[0].match(/:(.*?);/)[1];
    bstr = atob(arr[1]);
    n = bstr.length;
    u8arr = new Uint8Array(n);
    while (n--) {
        u8arr[n] = bstr.charCodeAt(n);
    }
    return new File([u8arr], name, {
        type: mime,
    })
}